<!-- saved from url=(0007)http:// -->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Infor.SST.AsyncMethods.AsyncOperation</TITLE>
<LINK REL=STYLESHEET HREF="../CommentReport.css" TYPE="text/css">
</HEAD>
<BODY topmargin=0 rightmargin=0 leftmargin=0 style="background-image: url(../titletile.jpg); background-repeat:repeat-x; background-position: 0 0;" >
<DIV CLASS="PageHeading">Infor.SST.AsyncMethods.AsyncOperation Class</DIV>
<DIV CLASS="Description">

The abstract class for AsyncOperation
<P>

</DIV>
<IMG src="../GradLeft.jpg" width=7 height=378 alt="" border="0" style="position:absolute; left:10; top:18;z-Index:2">
<IMG src="../GradTop.jpg" width=352 height=7 alt="" border="0" align="top" style="position:absolute; left:10; top:18; z-index:1">
<DIV CLASS="Remarks">
<SPAN CLASS="RemarkHdrX">Access: </SPAN>Public</DIV>
<DIV CLASS="Remarks">
<SPAN CLASS="RemarkHdrX">Base Classes: </SPAN>Object</DIV>
<TABLE CLASS="InfoTable" cellpadding=0 cellspacing=0>
<TR height=20>
<TD width=20>&nbsp;</TD>
<TD valign=top align=left width=9 bgcolor="#cccc66"><IMG SRC="../graycorner.jpg" align=top></TD>
<TD CLASS="TableLightLabel" WIDTH=206>Members</TD>
<TD CLASS="TableLightLabel" >Description</TD>
<TD width=20>&nbsp;</TD>
</TR>
<TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP12.HTM" TARGET="CNTFRAME">AsyncOperation</A></TD>
<TD CLASS="TableLightDesc">
Initialises an AsyncOperation with an association to the
supplied ISynchronizeInvoke.  All events raised from this
object will be delivered via this target.  (This might be a
Control object, so events would be delivered to that Control's
UI thread.)
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP13.HTM" TARGET="CNTFRAME">Start</A></TD>
<TD CLASS="TableLightDesc">
Launch the operation on a worker thread.  This method will
return immediately, and the operation will start asynchronously
on a worker thread.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP14.HTM" TARGET="CNTFRAME">Cancel</A></TD>
<TD CLASS="TableLightDesc">
Attempt to cancel the current operation.  This returns
immediately to the caller.  No guarantee is made as to
whether the operation will be successfully cancelled.  All
that can be known is that at some point, one of the
three events Completed, Cancelled, or Failed will be raised
at some point.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP15.HTM" TARGET="CNTFRAME">CancelAndWait</A></TD>
<TD CLASS="TableLightDesc">
Attempt to cancel the current operation and block until either
the cancellation succeeds or the operation completes.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP16.HTM" TARGET="CNTFRAME">WaitUntilDone</A></TD>
<TD CLASS="TableLightDesc">
Blocks until the operation has either run to completion, or has
been successfully cancelled, or has failed with an internal
exception.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP17.HTM" TARGET="CNTFRAME">IsDone</A></TD>
<TD CLASS="TableLightDesc">
Returns false if the operation is still in progress, or true if
it has either completed successfully, been cancelled
 successfully, or failed with an internal exception.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP19.HTM" TARGET="CNTFRAME">Target</A></TD>
<TD CLASS="TableLightDesc">
The ISynchronizeTarget supplied during construction - this can
be used by deriving classes which wish to add their own events.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP21.HTM" TARGET="CNTFRAME">isiTarget</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP22.HTM" TARGET="CNTFRAME">DoWork</A></TD>
<TD CLASS="TableLightDesc">
To be overridden by the deriving class - this is where the work
will be done.  The base class calls this method on a worker
thread when the Start method is called.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP23.HTM" TARGET="CNTFRAME">CancelRequested</A></TD>
<TD CLASS="TableLightDesc">
Flag indicating whether the request has been cancelled.  Long-
running operations should check this flag regularly if they can
and cancel their operations as soon as they notice that it has
been set.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP25.HTM" TARGET="CNTFRAME">cancelledFlag</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP26.HTM" TARGET="CNTFRAME">HasCompleted</A></TD>
<TD CLASS="TableLightDesc">
Flag indicating whether the request has run through to
completion.  This will be false if the request has been
successfully cancelled, or if it failed.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP28.HTM" TARGET="CNTFRAME">completeFlag</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP29.HTM" TARGET="CNTFRAME">AcknowledgeCancel</A></TD>
<TD CLASS="TableLightDesc">
This is called by the operation when it wants to indicate that
it saw the cancellation request and honoured it.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP30.HTM" TARGET="CNTFRAME">cancelAcknowledgedFlag</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP31.HTM" TARGET="CNTFRAME">failedFlag</A></TD>
<TD CLASS="TableLightDesc">
Set to true if the operation fails with an exception.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP32.HTM" TARGET="CNTFRAME">isRunning</A></TD>
<TD CLASS="TableLightDesc">
Set to true if the operation is running
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP33.HTM" TARGET="CNTFRAME">InternalStart</A></TD>
<TD CLASS="TableLightDesc">
This method is called on a worker thread (via asynchronous
delegate invocation).  This is where we call the operation (as
defined in the deriving class's DoWork method).
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP34.HTM" TARGET="CNTFRAME">CompleteOperation</A></TD>
<TD CLASS="TableLightDesc">
This is called when the operation runs to completion.
(This is private because it is called automatically
by this base class when the deriving class's DoWork
method exits without having cancelled
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP35.HTM" TARGET="CNTFRAME">FailOperation</A></TD>
<TD CLASS="TableLightDesc">
Fires event when the operation fails.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP36.HTM" TARGET="CNTFRAME">FireAsync</A></TD>
<TD CLASS="TableLightDesc">
Utility function for firing an event through the target.
It uses C#'s variable length parameter list support
to build the parameter list.

This functions presumes that the caller holds the object lock.
(This is because the event list is typically modified on the UI
thread, but events are usually raised on the worker thread.)
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR></TABLE>
</BODY>
</HTML>
